// EventManager.h: interface for the EventManager class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_EVENTMANAGER_H__2A048DD8_4920_4B9A_8F32_FADA9A152DA8__INCLUDED_)
#define AFX_EVENTMANAGER_H__2A048DD8_4920_4B9A_8F32_FADA9A152DA8__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class Event;

class EventManager
{
protected:
	EventManager();
	virtual ~EventManager();

public:
	static EventManager * Instance();
	static void DeleteInstance();

	const std::list<Event *>& GetEvents() const {return m_Events;}

	void AddEvent(Event * pEvent);
	void NewEvent(const CTime& time, const CString& strUserId, const CString& strIPAddr, const CString& strDescription);
	void DeleteAllEvents();

	// UI utilities
	HTREEITEM InsertToTreeCtrl(CTreeCtrl& treectrl, HTREEITEM hItemParent) const;
	int InsertToListCtrl(CListCtrl& listctrl) const;

protected:
	std::list<Event *> m_Events;

private:
	static EventManager * m_pInstance;
};

#endif // !defined(AFX_EVENTMANAGER_H__2A048DD8_4920_4B9A_8F32_FADA9A152DA8__INCLUDED_)
